import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue'
import CaiboBuyuan from '../views/buyuan/caibo.vue'

import CaiboMemberManagement from '../views/buzhang/caibo/memberManagement.vue'
import CaiboDeptIntro from '../views/buzhang/caibo/deptIntro.vue'
import CaiboScheduleManagement from '../views/buzhang/caibo/scheduleManagement.vue'
import CaiboDepartmentMeeting from '../views/buzhang/caibo/departmentMeeting.vue'
import CaiboPersonalCenter from '../views/buzhang/caibo/personalCenter.vue'
import CaiboMemberDetail from '../views/buzhang/caibo/memberDetail.vue'

// 技术部组件导入
import JishuMemberManagement from '../views/buzhang/jishu/memberManagement.vue'
import JishuDeptIntro from '../views/buzhang/jishu/deptIntro.vue'
import JishuScheduleManagement from '../views/buzhang/jishu/scheduleManagement.vue'
import JishuDepartmentMeeting from '../views/buzhang/jishu/departmentMeeting.vue'
import JishuPersonalCenter from '../views/buzhang/jishu/personalCenter.vue'

// 办公室组件导入
import BangongshiMemberManagement from '../views/buzhang/bangongshi/memberManagement.vue'
import BangongshiDeptIntro from '../views/buzhang/bangongshi/deptIntro.vue'
import BangongshiDepartmentMeeting from '../views/buzhang/bangongshi/departmentMeeting.vue'
import BangongshiPersonalCenter from '../views/buzhang/bangongshi/personalCenter.vue'

// 电台部组件导入
import BuzhangDiantai from '../views/buzhang/diantai/index.vue'
import DiantaiMemberManagement from '../views/buzhang/diantai/memberManagement.vue'
import DiantaiDeptIntro from '../views/buzhang/diantai/deptIntro.vue'
import DiantaiDepartmentMeeting from '../views/buzhang/diantai/departmentMeeting.vue'
import DiantaiPersonalCenter from '../views/buzhang/diantai/personalCenter.vue'
import DiantaiMemberDetail from '../views/buzhang/diantai/memberDetail.vue'

// 主持队组件导入
import BuzhangZhuchi from '@/views/buzhang/zhuchi/index.vue'
import ZhuchiMemberManagement from '@/views/buzhang/zhuchi/memberManagement.vue'
import ZhuchiDeptIntro from '@/views/buzhang/zhuchi/deptIntro.vue'
import ZhuchiDepartmentMeeting from '@/views/buzhang/zhuchi/departmentMeeting.vue'
import ZhuchiPersonalCenter from '@/views/buzhang/zhuchi/personalCenter.vue'
import ZhuchiMemberDetail from '@/views/buzhang/zhuchi/memberDetail.vue'
import ZhuchiTalentPool from '@/views/buzhang/zhuchi/talentPool.vue'

import DiantaiBuyuan from '../views/buyuan/diantai.vue'
import ZhuchiBuyuan from '../views/buyuan/zhuchi.vue'
import ZhuchiDetail from '../views/buyuan/zhuchiDetail.vue'
import XinmeitiBuyuan from '../views/buyuan/xinmeiti.vue'
import JishuBuyuan from '../views/buyuan/jishu.vue'
import BangongshiBuyuan from '../views/buyuan/bangongshi.vue'
import JingpinRadio from '../views/buyuan/AboutUs/JingpinRadio.vue'
import Activity from '../views/buyuan/AboutUs/Activity.vue'
import ChangdiReservation from '../views/buzhang/AboutUs/changdi.vue'
import Taiweihui from '../views/taiweihui.vue'

import Jishu from '@/views/buzhang/jishu.vue'
import JishuDetail from '@/views/buzhang/jishuDetail.vue'
import BuzhangBangongshi from '@/views/buzhang/bangongshi.vue'
import BuzhangBangongshiDetail from '@/views/buzhang/bangongshiDetail.vue'
import Xinmeiti from '@/views/buzhang/xinmeiti.vue'
import XinmeitiDetail from '@/views/buzhang/xinmeitiDetail.vue'
import BuzhangRadio from '@/views/buzhang/AboutUs/Radio.vue'
import RecruitmentManagement from '@/views/buzhang/AboutUs/activity/RecruitmentManagement.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: {
        showHeaderFooter: true
      }
    },
    {
      path: '/buyuan/caibo',
      component: CaiboBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    // 采播部路由配置
    {
      path: '/buzhang/caibo',
      meta: {
        showHeaderFooter: false
      },
      component: () => import('../views/buzhang/caibo/index.vue'),
      children: [
        {
          path: 'memberManagement',
          component: CaiboMemberManagement
        },
        {
          path: 'deptIntro',
          component: CaiboDeptIntro
        },
        {
          path: 'scheduleManagement',
          component: CaiboScheduleManagement
        },
        {
          path: 'departmentMeeting',
          component: CaiboDepartmentMeeting
        },
        {
          path: 'personalCenter',
          component: CaiboPersonalCenter
        },
        {
          path: 'memberDetail/:id',
          component: CaiboMemberDetail
        }
      ]
    },
    // 电台部路由配置（新增）
    {
      path: '/buzhang/diantai',
      meta: {
        showHeaderFooter: false
      },
      component: () => import('../views/buzhang/diantai/index.vue'),
      children: [
        {
          path: 'memberManagement',
          component: DiantaiMemberManagement
        },
        {
          path: 'deptIntro',
          component: DiantaiDeptIntro
        },

        {
          path: 'departmentMeeting',
          component: DiantaiDepartmentMeeting
        },
        {
          path: 'personalCenter',
          component: DiantaiPersonalCenter
        },
        {
          path: 'memberDetail/:id',
          component: DiantaiMemberDetail
        }
      ]
    },
    {
      path: '/buyuan/diantai',
      component: DiantaiBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/zhuchi',
      component: ZhuchiBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/zhuchi/detail/:id?',
      component: ZhuchiDetail,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/xinmeiti',
      component: XinmeitiBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/jishu',
      component: JishuBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/bangongshi',
      component: BangongshiBuyuan,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/aboutus/jingpinradio',
      component: JingpinRadio,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buyuan/aboutus/activity',
      component: Activity,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/reserve',
      component: ChangdiReservation,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/committee',
      component: Taiweihui,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buzhang/diantai',
      name: 'BuzhangDiantai',
      component: BuzhangDiantai,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buzhang/diantai/memberDetail/:id',
      name: 'DiantaiMemberDetail',
      component: DiantaiMemberDetail,
      meta: {
        showHeaderFooter: false
      }
    },
    // 技术部路由配置
    {
      path: '/buzhang/jishu',
      meta: {
        showHeaderFooter: false
      },
      component: () => import('../views/buzhang/jishu/index.vue'),
      children: [
        {
          path: 'memberManagement',
          component: JishuMemberManagement
        },
        {
          path: 'deptIntro',
          component: JishuDeptIntro
        },
        {
          path: 'scheduleManagement',
          component: JishuScheduleManagement
        },
        {
          path: 'departmentMeeting',
          component: JishuDepartmentMeeting
        },
        {
          path: 'personalCenter',
          component: JishuPersonalCenter
        }
      ]
    },
    
    // 办公室路由配置
    {
      path: '/buzhang/bangongshi',
      meta: {
        showHeaderFooter: false
      },
      component: () => import('../views/buzhang/bangongshi/index.vue'),
      children: [
        {
          path: 'memberManagement',
          component: BangongshiMemberManagement
        },
        {
          path: 'deptIntro',
          component: BangongshiDeptIntro
        },
        {
          path: 'departmentMeeting',
          component: BangongshiDepartmentMeeting
        },
        {
          path: 'personalCenter',
          component: BangongshiPersonalCenter
        }
      ]
    },
    
    // 主持队路由配置
    {
      path: '/buzhang/zhuchi',
      meta: { showHeaderFooter: false },
      component: BuzhangZhuchi,
      children: [{
        path: 'memberManagement',
        component: ZhuchiMemberManagement
      },
      {
        path: 'deptIntro',
        component: ZhuchiDeptIntro
      },
      {
        path: 'departmentMeeting',
        component: ZhuchiDepartmentMeeting
      },
      {
        path: 'personalCenter',
        component: ZhuchiPersonalCenter
      },
      {
        path: 'memberDetail/:id',
        component: ZhuchiMemberDetail
      },
      {
        path: 'talentPool',
        component: ZhuchiTalentPool
      }]
    },
    {
      path: '/buzhang/xinmeiti',
      name: 'buzhangXinmeiti',
      component: Xinmeiti,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buzhang/xinmeitiDetail',
      name: 'buzhangXinmeitiDetail',
      component: XinmeitiDetail,
      meta: {
        showHeaderFooter: false
      }
    },
    {
      path: '/buzhang/aboutus/radio',
      name: 'BuzhangRadio',
      component: BuzhangRadio,
      meta: {
        requiresAuth: true,
        role: 'minister',
        showHeaderFooter: false
      }
    },
    {
      path: '/buzhang/AboutUs/activity/recruitment',
      name: 'RecruitmentManagement',
      component: RecruitmentManagement,
      meta: {
        requiresAuth: true,
        role: 'minister',
        showHeaderFooter: false
      }
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {
        showHeaderFooter: true
      }
    },
  ]
})

export default router